package cn.ikun.dhj.jdbc;

import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.Statement;

public class AppJdbcDelete {
    public static void main(String[] args) throws Exception{
        Class.forName("com.mysql.jdbc.Driver");
        Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/shixi", "root", "root");
        Statement statement = connection.createStatement();
        String sql = "DELETE FROM user WHERE id = 5";
        int i = statement.executeUpdate(sql);
        if (i>0){
            System.out.println("删除成功");
        }

    }
}
